package com.zrt.bookstore3.Dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zrt.bookstore3.Domain.Book;
import com.zrt.bookstore3.Domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserDao extends BaseMapper<User>{

    @Select("select * from user")
    List<User> selectAll();

    @Insert("insert into user values (#{id},#{username},#{password},#{email},#{createTime},#{role},#{telephone})")
    int insert(User user);

    @Select("select * from user where username = #{username} and password = #{password}")
    User selectUserByUsernameAndPassword(String username,String password);


}
